set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -pthread  -fPIC ")

message(STATUS "CMAKE_CXX_FLAGS  " ${CMAKE_CXX_FLAGS})

include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/http)
include_directories(${PROJECT_SOURCE_DIR}/src/redis)

LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/lib)

##set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH}/demo)


if(ENABLE_USE_LOGCPLUS) 
add_definitions(-DENABLE_USE_LOGCPLUS)
include_directories($ENV{HOME}/include)
endif()

add_executable(echoserver_test echoserver_test.cpp)
target_link_libraries(echoserver_test toptnet)

add_executable(echoclient_test echoclient_test.cpp)
target_link_libraries(echoclient_test toptnet)

add_executable(httpserver_test httpserver_test.cpp)
target_link_libraries(httpserver_test toptnet toptnet_http)

add_executable(httpclient_test httpclient_test.cpp)
target_link_libraries(httpclient_test toptnet toptnet_http)

add_executable(wsserver_test wsserver_test.cpp)
target_link_libraries(wsserver_test toptnet toptnet_http)

add_executable(wsclient_test wsclient_test.cpp)
target_link_libraries(wsclient_test toptnet toptnet_http)

add_executable(timer_test timer_test.cpp)
target_link_libraries(timer_test toptnet rt)

add_executable(timingwheel_test timingwheel_test.cpp)
target_link_libraries(timingwheel_test toptnet rt)

add_executable(signaler_test signaler_test.cpp)
target_link_libraries(signaler_test toptnet)

add_executable(notifier_test notifier_test.cpp)
target_link_libraries(notifier_test toptnet)

add_executable(redisclient_test redisclient_test.cpp)
target_link_libraries(redisclient_test toptnet toptnet_redis)

add_executable(cometserver_test cometserver_test.cpp)
target_link_libraries(cometserver_test toptnet toptnet_http)

add_executable(cometclient_test cometclient_test.cpp)
target_link_libraries(cometclient_test toptnet toptnet_http)

add_executable(smtpclient_test smtpclient_test.cpp )
target_link_libraries(smtpclient_test toptnet)

add_executable(logutil_test logutil_test.cpp )
target_link_libraries(logutil_test toptnet)

add_executable(fnotify_test fnotify_test.cpp )
target_link_libraries(fnotify_test toptnet)

add_executable(tcpclient_test tcpclient_test.cpp )
target_link_libraries(tcpclient_test toptnet)